package com.ebelter.scaleblesdk.util;

import android.util.Log;



/**
 * 日志输出类
 *
 * @author fenghui
 * @date 2014年9月9日
 */
public class ULog {


    /**
     * Log级别,规范Log打印环境
     **/
    public static final int MODE_VERBOSE = 1;
    public static final int MODE_DEBUG = 2;
    public static final int MODE_INFO = 3;
    public static final int MODE_WARM = 4;
    public static final int MODE_ERROR = 5;
    public static final int MODE_PRODUCT = 6;
    /**
     * 决定Log是否打印，默认为MODE_DEBUG模式，供开发人员使用，发版前将根据AppConfig，指定对应的Log级别
     **/
    private static int logMode = MODE_DEBUG;
    //	开启单线程线程池线程输出Log

    //	不允许实例化
    private ULog() {
    }

    public static void setLogMode(int mode) {
        logMode = mode;
    }


    public static void v(final String tag, final String msg) {
        if (logMode <= MODE_VERBOSE) {
            Log.v(tag, msg);

        }
    }

    public static void d(final String tag, final String msg) {
        if (logMode <= MODE_DEBUG) {
            Log.d(tag, msg);
        }
    }

    public static void i(final String tag, final String msg) {
        if (logMode <= MODE_INFO) {
            Log.i(tag, msg);
        }
    }

    public static void w(final String tag, final String msg) {
        if (logMode <= MODE_WARM) {
            Log.w(tag, msg);
        }
    }

    public static void e(final String tag, final String msg) {
        if (logMode <= MODE_ERROR) {
            Log.e(tag, msg);
        }
    }


}